package com.yupi.yuojcodesandbox.judge.codesandbox;


import com.yupi.yuojcodesandbox.judge.codesandbox.enums.ExampleCodeSandbox;
import com.yupi.yuojcodesandbox.judge.codesandbox.impl.RemoteCodeSandbox;
import com.yupi.yuojcodesandbox.judge.codesandbox.impl.ThirdPartyCodeSandbox;

/**
 * @Author:Dong
 * @Date: 2024/4/20  11:44
 * @Version 1.0
 * 代码沙箱工厂
 */
public class CodeSandboxFactory {
    public static CodeSandbox newInstance(String type){
        switch(type){
            case "example":
                return new ExampleCodeSandbox();
            case "remote":
                return new RemoteCodeSandbox();
            case "thirdParty":
                return new ThirdPartyCodeSandbox();
            default:
                return new ExampleCodeSandbox();
        }
    }
}
